package com.example.ws.handler.elsearch;

import com.example.ws.handler.elog.ELogHandler;
import com.example.ws.util.Container;

import io.javalin.apibuilder.EndpointGroup;
import lombok.extern.slf4j.Slf4j;
import static io.javalin.apibuilder.ApiBuilder.*;

import io.javalin.http.Context;

@Slf4j
public class ElSearchHandler implements EndpointGroup {

    public static final ElSearchService search = Container.INSTANCE.getObjectByClass(ElSearchService.class);

    @Override
	public void addEndpoints() {
        
        get("elasticsearch", ElSearchHandler::info);
    
    }

    public static void info(Context ctx) {
        ctx.result(search.info());
    }

}